/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Ejercicio01;

/**
 *
 * @author yshenys
 */
public class Lista {
    
    private Persona L[];
    private int n;
 
    public Lista() {
        L=new Persona[50];
        n=0;
    }
    public void agregar(Persona x)
    {
        L[n]=x;
        n++;
    }
    public Persona getPersona(int p)
    {
        if(p>=0 && p<getN())
            return L[p];
        else
            return null;
    }
    public int getN()
    {
        return n;
    }
    @Override
    public String toString()
    {
        String s="";
        for(int i=0;i<getN();i++)
            s=s+"n"+L[i];
        return s;
         
    }
}